package fr.uvsq.isty.bdh.hchess.gui.style;

import fr.uvsq.isty.bdh.hchess.gui.MainWindow;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;

/**
 *
 * @author Florent Hemmi <florent.hemmi@gmail.com>
 */
public class RadioListener implements ActionListener {
    
    private MainWindow m;
    private Style style;
    
    public RadioListener(MainWindow m) {
        this.m = m;
    }
    
    public void actionPerformed(ActionEvent e) {
        try {
            style = Style.getInstance();
            style.setCurrentStyleName(e.getActionCommand());
            m.repaint();
        } catch (IOException ex) {}
    }
    
}
